import { request } from "@/utils/http.js";

import globalConfig from "@/utils/config.js";

const baseUrl = globalConfig.microUrl;

export default {
  // 分类详情
  listPage: (data) => {
    return request({
      url: `${baseUrl}/ct/news/page`,
      method: "GET",
      data
    });
  },

  // 意见反馈
  feedBackAdd: (data) => {
    return request({
      url: `${baseUrl}/ct/feedBack/create`,
      method: "POST",
      data
    });
  },

  // 新_有料头条首页列表
  getNewsList: (data) => {
    return request({
      url: `${baseUrl}/ct/news/getNewsMainInterfaceList`,
      method: "GET",
      data
    });
  },

  // 帮助中心
  helpById: (data) => {
    return request({
      url: `${baseUrl}/ct/help/get`,
      method: "GET",
      data
    });
  },
  // 申请入驻
  //   storeApplyAdd: (data) => {
  //     return request({url: baseUrl + '/st/storeApply/add', method: "POST", data: data})
  //   },
  // 资讯
  //   listPage: (data) => http.get('/ct/news/page', {params:data}), //资讯_分页列表

  // 资讯分类
  cateList: (data) => {
    return request({
      url: `${baseUrl}/ct/news/cate/list`,
      method: "GET",
      data
    });
  },
  // 分页资讯
  newsPageList: (data) => {
    return request({
      url: `${baseUrl}/ct/news/page`,
      method: "GET",
      data
    });
  },
  // 不分页
  newsList: (data) => {
    return request({
      url: `${baseUrl}/ct/news/list`,
      method: "GET",
      data
    });
  },
  // 广告-不分页
  bannerList: (data) => {
    return request({
      url: `${baseUrl}/ct/banner/list`,
      method: "GET",
      data
    });
  },
  getOpenId: (data) => {
    return request({
      url: `${baseUrl}/uc/user/wx/getYLWeAppOpenId`,
      method: "GET",
      data
    });
  },
  // 获取微信支付参数
  wxJsApiPay: (data) => {
    return request({
      url: `${baseUrl}/orderPay/wxJsApiPay`,
      method: "POST",
      data
    });
  },

  // 百科推荐列表
  baikeRecommonList: (data) => {
    return request({
      url: `${baseUrl}/system/baike/page`,
      method: "GET",
      data
    });
  },
  // cas列表
  casList: (data) => {
    return request({
      url: `${baseUrl}/system/baike/getCasScopeList`,
      method: "GET",
      data
    });
  },
  // 推荐商品
  baikeRecommendGoods: (data) => {
    return request({
      url: `${baseUrl}/gd/goods/getBaikeGoodsRecommPage`,
      method: "GET",
      data
    });
  },
  // 百科列表
  baikeResultList: (data) => {
    return request({
      url: `${baseUrl}/system/baike/page`,
      method: "GET",
      data
    });
  },
  // 百科详情
  baikeDetail: (data) => {
    return request({
      url: `${baseUrl}/system/baike/get`,
      method: "GET",
      data
    });
  },
  // 查看百科
  seeBaike: (data) => {
    return request({
      url: `${baseUrl}/system/baike/getBaikeCas`,
      method: "GET",
      data
    });
  },

  // -------------- 有料指数 ----------------

  // 有料指数-日期列表
  getExponentDateList: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/getDateList`,
      method: "GET",
      data
    });
  },
  // 有料指数列表
  getExponentList: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/list`,
      method: "GET",
      data
    });
  },
  // 有料指数添加/取消自选
  followGoodsQuote: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/followGoodsQuote`,
      method: "POST",
      data
    });
  },
  // 有料指数热门产品
  getHotGoodsQuote: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/getHotGoodsQuote`,
      method: "GET",
      data
    });
  },

  // 首页有料指数趋势图
  getPriceTrend: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/getPriceTrend`,
      method: "GET",
      data
    });
  },

  // 某个指数点击量统计
  GoodsQuoteBrowseCount: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuoteBrowse/browseCount`,
      method: "POST",
      data
    });
  },

  // 指数分享页-指数详情
  getGoodsQuoteDetail: (data) => {
    return request({
      url: `${baseUrl}/ct/goodsQuote/get`,
      method: "GET",
      data
    });
  },

  // ----------------------- 精选品牌 -------------------------
  // 精选品牌
  brandPreference: (data) => {
    return request({
      url: `${baseUrl}/ct/brandPreference/list`,
      method: "GET",
      data
    });
  },
  // 品牌馆列表
  brandHouseList: (data) => {
    return request({
      url: `${baseUrl}/ct/brandHouse/page`,
      method: "GET",
      data
    });
  },
  //
  interfaceSkinList: (data) => {
    return request({
      url: `${baseUrl}/ct/interfaceSkin/list`,
      method: "GET",
      data
    });
  },
  // 首页广告弹窗
  getIndexPopup: (data) => {
    return request({
      url: `${baseUrl}/ct/banner/getIndexPopup`,
      method: "GET",
      data
    });
  },
  // 首页引导弹窗
  popupLogCount: (data) => {
    return request({
      url: `${baseUrl}/ct/popupLog/count`,
      method: "GET",
      data
    });
  }
};
